using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class web_pages_nguoitimviec_hosodatao : System.Web.UI.UserControl
{
    public string act = "";
    public string id = "";
    public string name = "";
    Common comm = new Common();
    public DataTable dtt;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["act"])) act = comm.TextFormat(Request.QueryString["act"]).Trim();
            if (!string.IsNullOrEmpty(Request.QueryString["id"])) id = comm.TextFormat(Request.QueryString["id"]).Trim();
            if (Session["NTV_id"] == null)
            {
                Session.Remove("sNTV");
                Response.Redirect("nguoitimviec.aspx");
            }
            else
            {
                dtt = comm.getDataTable("select * from NguoiTimViec_ho_so where ma_nguoi='" + Session["NTV_id"].ToString() + "'");
                name = comm.execScalar("select ho_ten from ConNguoi_nguoi where ma_nguoi='" + Session["NTV_id"].ToString() + "'");
                rpt_list_obj.DataSource = dtt;
                rpt_list_obj.DataBind();
            }
        }
    }
    protected void btn_tao_ho_so_Click(object sender, EventArgs e)
    {
        Session.Remove("sNTV");
        Response.Redirect("~/web/pages/nguoitimviec_taohoso_b1.aspx");
    }
    protected void rpt_list_obj_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {

        RadioButton _chk = e.Item.FindControl("chk_kichhoat") as RadioButton;
        DataRowView r = (DataRowView)e.Item.DataItem;
        if ((Boolean)r["kich_hoat"])
        {
            _chk.Checked = true;
        }
        else
        {
            _chk.Checked = false;
        }
    }
}
